Platform: Windows#6935
Conversation
Arch: x64 Compiler: VS2015 When running node with --evail or --require without the required argument, node would segfault. This should correct that and display a reasonable error message again.
|
@Kelmar I couldn't reproduce the problem ➜ node git:(master) node -e 'console.log(process.version)'
v6.2.0
➜ node git:(master) node --eval
node: --eval requires an argument
➜ node git:(master) node --require
node: --require requires an argument
➜ node git:(master) node --evail
node: bad option: --evailEdit: Do you mean, this is specific to Windows? |
|
It looks to me like this is a bug, but it might be better to fix it in node_main.cc: In this line, there is no additional slot for the trailing |
|
@addalex That is probably a more correct fix yes. The assumption seems to be that argv would be terminated with a nullptr, but apparently wasn't the case when I mistakenly did a "node -e" command and got a segfault. |
|
@Kelmar Would you be interested in updating this PR with that fix or creating a new one? |
|
|
|
@thefourtheye Yeah, I know. It’s standard-mandated that |
|
@addaleax I would be happy to make the change. :) |
|
@Kelmar Great! Let us know if you need anything. :) |
|
Ah, okay. If the standard mandates then lets do it. cc @bnoordhuis |
|
I have created a new pull request arg_segfault_fix_2 :) |
|
Closing this in favour of #6938 then :) |
Platform: Windows
Arch: x64
Compiler: VS2015
When running node with --eval or --require without the required argument,
node would segfault. This should correct that and display a reasonable
error message again.